package main

import (
	"fmt"
	"runtime"
	"strconv"
	"time"
)

func goTest(i int) {
	fmt.Println("hello go " + strconv.Itoa(i))
}

func main() {
	//获取cpu的数量
	cpuNum := runtime.NumCPU()
	fmt.Printf("cpu num is %d", cpuNum)
	//set cpu max num
	runtime.GOMAXPROCS(cpuNum)
	for i := 0; i <= 1000000; i++ {
		go goTest(i)
	}

	time.Sleep(time.Second * 60)
}
